package com.trip.vo;

import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import java.time.LocalDateTime;

/**
 * Created by hc24 on 2017/10/18.
 */
public class CaptchaVo {
    @Email(message = "Invalid email")
    private String email;
    @NotEmpty
    @Length(min = 4,max = 4,message = "Invalid captcha code")
    private String code;

    private String pwd;
    @ApiModelProperty(hidden = true)
    private LocalDateTime createTime;

    public CaptchaVo(){}

    public CaptchaVo(String code, LocalDateTime createTime) {
        this.code = code;
        this.createTime = createTime;
    }

    public CaptchaVo(String code) {
        this.code = code;
        this.createTime=LocalDateTime.now();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
}
